<template>
	<el-dialog
		width="600px"
		:visible.sync="isShow"
		:show-close="false"
		:close-on-click-modal="false"
	>
		<template #title>
			<div class="dialog-title">试题包生成提示</div>
		</template>
		<div class="tip">
			<p>本次添加的试题已加入下方试题包，您可以通过搜索试题包将试题加入试卷。</p>
			<p class="paper-package">试卷包ID：{{ questionPackageId }}<span class="copy" @click="toCopy">复制</span></p>
		</div>
		<div class="submit-btns">
			<el-button
				type="default"
				class="theme_font_color theme-border-color"
				@click="onSubmit"
				:loading="isLoading"
			>
				返回试题列表
			</el-button>
		</div>
	</el-dialog>
</template>
<script>

	export default {
		name: "test-specification",
		props: {
		},
		data() {
			return {
				isShow: false,
                isLoading:false,
                questionPackageId:""
			};
		},
        methods:{
            open(id=""){
                this.questionPackageId = id ;
                this.isShow = true;
            },
             onSubmit(){
               this.$emit("back");
            },
            // 复制
            toCopy(){
                if (StringUtil.copyText(this.questionPackageId)) {
                    this.$message.success("复制成功");
                } else {
                    this.$message.error("复制失败");
                }
            }
        }
	};
</script>
<style scoped lang="less">
	.dialog-title {
		text-align: center;
		font-size: 16px;
		color: #333;
	}
	.tip {
		text-align: center;
		margin-bottom: 20px;
	}
    .paper-package{
        margin-top: 15px;
    }
	.copy {
		color: #ff4436;
        cursor: pointer;
        margin-left: 20px;
	}
	.submit-btns {
		display: flex;
		justify-content:center;
	}
</style>
